package com.sgcc.nfc.lock.data.remote.api

import com.sgcc.nfc.lock.core.network.ApiResponse
import com.sgcc.nfc.lock.data.remote.dto.PagedDataDto
import com.sgcc.nfc.lock.data.remote.dto.warning.WarningDto
import retrofit2.http.GET
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface WarningApi {

    @GET("/api/v1/warning/list")
    suspend fun getWarnings(
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int,
        @Query("status") status: Int? = null,
        @Query("warningType") warningType: Int? = null,
        @Query("regionId") regionId: Long? = null
    ): ApiResponse<PagedDataDto<WarningDto>>

    @GET("/api/v1/warning/{warningId}")
    suspend fun getWarningDetail(
        @Path("warningId") warningId: Long
    ): ApiResponse<WarningDto>

    @PUT("/api/v1/warning/handle/{warningId}")
    suspend fun handleWarning(
        @Path("warningId") warningId: Long,
        @Query("remark") remark: String?
    ): ApiResponse<Unit>
}
